<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:uddi="urn:uddi-org:api_v3">
	<xsl:output method="xml" encoding="UTF-8"/>

	<!-- Match the discovery URLs UDDI element -->
	<xsl:template match="uddi:discoveryURLs">
		<xsl:variable name="discoveryURLCount"><xsl:value-of select="count(uddi:discoveryURL)"/></xsl:variable>
		<fieldset>
			<legend>Discovery URLS [<xsl:value-of select="$discoveryURLCount"/>]</legend>
			<xsl:if test="$discoveryURLCount > 0">
				<table>
				    <tr>
				    	<th>Use Type</th>
				    	<th>URL</th>
				    </tr>
					<xsl:apply-templates match="uddi:discoveryURL"/>
				</table> 
			</xsl:if>
		</fieldset>
	</xsl:template>
	
	<xsl:template match="uddi:discoveryURL">
		<tr>
			<td><xsl:value-of select="@useType"/></td>
			<td>
			<a>
			<xsl:attribute name="href"><xsl:value-of select="."/></xsl:attribute>
			<xsl:value-of select="."/>
			</a>
			</td>
		</tr>
	</xsl:template>
</xsl:stylesheet>